for i in range(1, 10):
    for j in range(1, i+1):
        print('{}x{}={}\t'.format(j,i,i*j), end=' ')
    print()
print('*****'*15)

for a in range(9,0,-1):
    for b in range(1, 10):
        if b <= a:
            print('{}x{}={}\t'.format(b,a,a*b), end=' ')
    print()
print('*****'*15)